package com.mzplayer.player;

import android.view.Surface;

import com.mzplayer.utils.MediaData;

import java.io.IOException;

public interface MediaPlayer {

    void setDataSource(MediaData mediaData) throws IOException;

    void prepareAsync();

    void reset();

    boolean isPlaying();

    void start();

    void pause();

    void stop();

    void seekTo(long j);

    long getCurrentPosition();

    long getDuration();

    void setSurface(Surface surface);

    void setSpeed(float speed);

    long getTcpSpeed();

    void release();

    void setCallback(Callback callback);

    void usingMediaCodec();

    void rtspUsingTCP();

    interface Callback {

        void onLoadingStart();

        void onLoadingFlush(int percent);

        void onLoadingEnd();

        void onVideoRotationChanged(int degree);

        void onVideoSizeChanged(int width, int height, int sar_num, int sar_den);

        void onBufferingUpdate(int percent);

        void onPreparing();

        void onPrepared();

        void onCompletion();

        boolean onError(int what, int extra);

        void onTimedText(String text);
    }
}
